home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / STRINGS / PACKAGE6 / CONCAT.DOC < prev    next >
Text File  |  1990-07-25  |  2KB  |  49 lines

  1. ---------------------------------------------------------------------------
  2. Concatenate
  3. ---------------------------------------------------------------------------
  4.  
  5.  
  6. declaration:    procedure Concatenate (     StringOne,
  7.                                              StringTwo :
  8.                                                TypeString ;
  9.                                          var ResultString :
  10.                                                TypeString ) ;
  11.  
  12. purpose:        Concatenates two strings.
  13.  
  14. preconditions:  StringOne and StringTwo were originally initialized.
  15.                 ResultString is undefined ( or has a value which will
  16.                 be deleted in its initialization ).
  17.  
  18. postconditions: ResultString has been initialized and is the concatenation
  19.                 of StringOne and StringTwo.
  20.  
  21. special cases:  If the sum of the Lengths of StringOne and StringTwo is
  22.                 greater than MaxStringLength then the ResultString will
  23.                 be truncated to MaxStringLength.
  24.  
  25. example         var
  26.                   FirstName,
  27.                   LastName,
  28.                   FullName:
  29.                     TypeString;
  30.                   LastKey:
  31.                     TypeKey;
  32.  
  33.                 begin
  34.                   .
  35.                   .
  36.                   .
  37.                   write ( output, 'Enter first name :' );
  38.                   ReadLnString ( FirstName, MaxStringLength, LastKey );
  39.                   FirstName.Length := FirstName.Length + 1;
  40.                   write ( output, 'Enter last name :' );
  41.                   ReadLnString ( LastName, MaxStringLength, LastKey );
  42.                   Concatenate ( FirstName, LastName, FullName );
  43.                   .
  44.                   .
  45.                   .
  46.                 end
  47.  
  48. ---------------------------------------------------------------------------
  49.